{extend name="web/public/base" /}
{block name="header"}
{/block}
{block name="main"}
<section class="scrollable padder">
    <ul class="breadcrumb no-border no-radius b-b b-light pull-in">
        <li><a><i class="fa fa-home"></i> 首页</a></li>
        <li class="active">系统配置</li>
        <li class="active">{$title}</li>
    </ul>
    <div class="row">
        <div class="col-sm-12">
            <section class="panel panel-default">
                <header class="panel-heading font-bold">{$title}</header>
                <div class="panel-body">
                    <form action="{:url('')}" onsubmit="return false;" method="post" id="ajaxform">
                        <div class="row col-md-10">
                            <div class="row col-lg-12">
                                <div class="form-group col-sm-6">
                                    <label>栏目名称</label>
                                    <input type="text" id="title" name="title" class="form-control" placeholder="栏目名称"
                                           value="{$info.title}">
                                </div>
                                <div class="form-group col-sm-6">
                                    <label>栏目url</label>
                                    <input type="text" name="url" class="form-control" placeholder="栏目url"
                                           value="{$info.url}">
                                </div>
                            </div>
                            <div class="row col-lg-12">
                                <div class="form-group col-sm-6">
                                    <label>排序</label>
                                    <input type="text" name="sort" class="form-control" placeholder="排序"
                                           value="{$info.sort}">
                                </div>
                                <div class="form-group col-sm-6">
                                    <label>是否隐藏</label>
                                    <div>
                                        <label class="radio-inline">
                                            <input type="radio" name="status" value="0" {if condition="$info['status'] eq 0"}checked="checked"{/if}> 隐藏
                                        </label>
                                        <label class="radio-inline">
                                            <input type="radio" name="status" value="1" {if condition="$info['status'] eq 1"}checked="checked"{/if}> 正常
                                        </label>
                                    </div>

                                </div>
                            </div>
                            <footer class="panel-footer text-right bg-light lter col-sm-12">
                                <input type="hidden" name="id" value="{$info.id}">
                                <button type="submit" class="btn btn-success btn-s-xs">提 交</button>
                            </footer>
                        </div>
                    </form>
                </div>
            </section>
        </div>
    </div>
</section>
{/block}
{block name="script"}
<script type="text/javascript">
    $(function () {
        $.validator.setDefaults({
            submitHandler: function () {
                ajaxSubmit();
            },
            highlight: function (element, errorClass) {
                $(element).css('border', '2px solid red');
            },
            unhighlight: function (element, errorClass) {
                $(element).css('border', '1px solid green');
            }
        });

        $('#ajaxform').validate({
            rules: {
                title: "required"
            },
            messages: {
                title: "请输入栏目名称"
            }
        });
    })
</script>
{/block}
